package com.guoli.print;

import java.io.IOException;
import java.util.Enumeration;

import javax.comm.CommPortIdentifier;

public class Test {
	@SuppressWarnings("unchecked")
	public static void main(String[] args) throws IOException {
//		PrintStream ps = System.out;
//		File f = new File("F:\\bak\\print\\test.prn");
//		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
//		String str = null;
//		StringBuffer sb = new StringBuffer();
//		while((str=br.readLine())!=null){
//			sb.append(str+"\n");
//		}
//		ps.print(sb.toString().getBytes());
		Enumeration<CommPortIdentifier> epis = CommPortIdentifier.getPortIdentifiers();
		while(epis.hasMoreElements()){
			System.out.println(epis.nextElement().getName());
		}
		String a = "1111";
		System.out.println(Integer.toHexString(Integer.parseInt(a, 2)));
	}
}
